<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="img-font/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="img-font/font/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="css/css.css" />
		<link rel="stylesheet" type="text/css" href="css/shouru.css" />
		<link rel="stylesheet" type="text/css" href="css/weui.css" />
		<script src="js/jquery.min.js"></script>
		<script src="js/main.js"></script>
		<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
		<script src="js/Url.js"></script>
	</head>
	<style type="text/css">
		.choice {
			width: 100%;
			height: 100%;
			background: rgba(0, 0, 0, 0.4);
			position: fixed;
			top: 0;
			left: 0;
			display: none;
		}
		
		.choice_payment {
			width: 90%;
			height: 40%;
			background: #fff;
			position: absolute;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%);
			border-radius: 5px;
			color: #0AE;
		}
		
		.banner_title {
			width: 70px;
			margin-left: 10px;
			margin-top: 10px;
		}
		
		.choice_form {
			width: 100%;
			height: 100%;
			border-top: 1px solid #eee;
			text-align: center;
			padding: 15px 0px;
		}
		
		.Mat {
			width: 100%;
			height: 20px;
		}
		
		.choice_button {
			width: 100px;
			height: 35px;
			border: 0;
			border-radius: 5px;
			color: #fff;
			background: #0AE;
		}
		
		.choice_input {
			height: 30px;
		}
		
		.choice_input2 {
			height: 30px;
		}
		
		.span_mony {
			color: red;
		}
		
		.my_konng {
			width: 90px;
			height: 35px;
			line-height: 35px;
			position: absolute;
			left: 10px;
			top: 20px;
			color: #827f7f;
			border: 0;
			background: url(images/wdkj.png);
			background-size: 100% 100%;
			font-size: 13px;
			font-weight: bold;
			color: #300c0c;
		}
		
		.weui-dialog {
			display: none;
		}
		
		.weui-dialog_2 {
			position: fixed;
			z-index: 5000;
			width: 80%;
			max-width: 300px;
			top: 50%;
			left: 50%;
			-webkit-transform: translate(-50%, -50%);
			transform: translate(-50%, -50%);
			background-color: #FFFFFF;
			text-align: center;
			border-radius: 3px;
			overflow: hidden;
			display: none;
		}
	</style>

	<body>
		<div class="fabuw">
			<div class="banner-img">
				<div class="banner"></div>
				<div class="IDS"><span></span><i></i></div> <button class="tixian"></button> </div>

			<a href="personalPage.html"><button class="my_konng">我的空间</button></a>
			<div class="daohan">
				<div class="wdye ggj"> <span>0</span><br /> 游戏币 </div>
				<div class="wdye zs"> <span>0</span><br /> 赠送广告金 </div>
				<div class="wdye yj"> <span>0</span><br /> 我的佣金 </div>
				<div class="wdye zc"> <span>0</span><br /> 我的支出 </div>
			</div>
			<div class="div-a">
				<div class="jilu">
					<a href="subpage/ggao-record.html">
						<div class="fggao">
							<span class="ispan"></span> 发广告纪录<span class="iconfont icon-yousanjiao-copy-copy spanss"></span>
						</div>
					</a>
				</div>
				<div class="huod tuan" onclick="ction()">
					<a href="#">
						<div class="juan">
							<span class="zspan"></span>发布广告<span class="iconfont icon-yousanjiao-copy-copy spanss"></span>
						</div>
					</a>
				</div>
				<div class="huod jiluy">
					<a href="subpage/Get-commission.html">
						<div class="juan">
							<span class="hspan"></span> 获得佣金纪录<span class="iconfont icon-yousanjiao-copy-copy spanss"></span>
						</div>
					</a>
				</div>
				<div class="huod tuan">
					<a href="subpage/Expenditure-record.html">
						<div class="juan">
							<span class="zspan"></span> 我的支出纪录<span class="iconfont icon-yousanjiao-copy-copy spanss"></span>
						</div>
					</a>
				</div>
				<div class="huod jiluy">
					<a href="subpage/RewardRecord.html">
						<div class="juan">
							<span class="hspan"></span> 未领取奖励<span class="iconfont icon-yousanjiao-copy-copy spanss"></span>
						</div>
					</a>
				</div>
				<div class="huod tuan">
					<a href="subpage/OrderRecord.html">
						<div class="juan">
							<span class="zspan"></span>用户订单记录<span class="iconfont icon-yousanjiao-copy-copy spanss"></span>
						</div>
					</a>
				</div>
				<div class="huod jiluy">
					<a href="subpage/problem-2.html">
						<div class="chang">
							<span class="cspan"></span> 常见问题<span class="iconfont icon-yousanjiao-copy-copy spanss"></span>
						</div>
					</a>
				</div>
				<div class="wenti last">
					<a href="subpage/service.html">
						<div class="chang">
							<span class="lspan"></span> 联系客服<span class="iconfont icon-yousanjiao-copy-copy spanss"></span>
						</div>
					</a>
				</div>
				<div class="huod jiluy">
					<a href="subpage/follow.html">
						<div class="chang">
							<span class="cspan"></span>关注我们<span class="iconfont icon-yousanjiao-copy-copy spanss"></span>
						</div>
					</a>
				</div>

				<div class="wenti last">
					<a href="subpage/MyCellPhone.html">
						<div class="chang">
							<span class="lspan"></span> 绑定手机号<span class="iconfont icon-yousanjiao-copy-copy spanss"></span>
						</div>
					</a>
				</div>

				<p style="text-align: center; font-size: 12px;line-height: 24px; color: #0094ff; margin-top: 15px;">
					<a href="http://www.xsrkej.com/" style="color: #0094ff;">技术支持<br />广州心上人信息科技有限公司</a>
				</p>
			</div>
			<div class="choice">
				<div class="choice_payment">
					<div class="banner_title">
						<img src="images/zhifu.png" width="100%" />
					</div>
					<div class="choice_form">
						<p>账号：<input class="choice_input" onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" placeholder="请输入支付宝账号"></p>
						<div class="Mat"></div>
						<p>金额：<span class="span_mony">0</span>&ensp;佣金</p>
						<div class="Mat"></div>
						<button class="choice_button">提交</button>
					</div>
				</div>
			</div>
		</div>
		<footer>
			<div class="footers">
				<div class="tab2 yangs">
					<a href="/footballgame/index.html" class="indexs" style="background:url(images/play.png) center center no-repeat;
	background-size: 35% 100%;"></a>
				</div>
				<div class="tab3 yangs">
					<a href="#" class="indexs_2" style="background:url(images/ad.png) center center no-repeat;
	background-size: 35% 100%;"></a>
				</div>
				<div class="tab5 yangs">
					<a href="QR-code.html" class="indexs_3" style="background:url(images/code.png) center center no-repeat;
	background-size: 35% 100%;"></a>
				</div>
				<div class="tab4 yangs">
					<a href="income.html" class="indexs_5" style="background:url(images/my_1.png) center center no-repeat;
	background-size: 35% 100%;"></a>
				</div>
			</div>
		</footer>
		<div class="weui-dialog">
			<div class="weui-dialog__bd">弹窗样式</div>
			<div class="weui-dialog__ft">
				<a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary">知道了</a>
			</div>
		</div>
		<div class="weui-dialog_2">
			<div class="weui-dialog__hd"><strong class="weui-dialog__title">提现失败</strong></div>
			<div class="weui-dialog__bd">是否申请支付宝提现？</div>
			<div class="weui-dialog__ft">
				<a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_default">取消</a>
				<a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary">确定</a>
			</div>
		</div>
	</body>

</html>
<script type="text/javascript">
	function ction() {
		window.location.href = 'subpage/Release.html'
	}

	var cashCount = '';
	//请求个人详情
	$(function() {
		$.ajax({
			type: "get",
			url: baseUrl + "foot/user/getUserMessage",
			contentType: "application/json; charset=utf-8",
			dataType: "json",
			success: function(res) {
				console.log(res)
				$('.ggj >span').html(res.data.balanceMoney.toFixed(2));
				$('.zs >span').html(res.data.money.toFixed(2));
				$('.yj >span').html(parseFloat(res.data.commMoney).toFixed(2));
				$('.zc >span').html(res.data.expendMoney.toFixed(2));
				var openId = res.data.openid;

				$('.span_mony').html($('.yj >span').html())
				cashCount = res.data.cashCount;
			},
		});

		$('.span_mony').html($('.yj >span').html())

		var id = $('.IDS >i').html();

		$('.tixian').on('click', function() {
			var money = $('.yj >span').html() - 0;
			if(cashCount < 3 && cashCount >= 0) {
				if(money >= 1) {
					$('.weui-dialog').show();
					$('.weui-dialog__bd').html('当前提现次数为' + (3 - cashCount) + '次');
					$.ajax({
						type: "POST",
						url: baseUrl + "foot/user/updateAction",
						success: function(res) {
							console.log(res);
							if(res.error_code == 0) {
								alert(res.data + '！');
							} else if(res.error_code == 1) {
								$('.weui-dialog_2').show();
								$('.weui-dialog__btn_default').on('click', function() {
									$('.weui-dialog_2').hide();
									window.location.reload();
								})
								$('.weui-dialog__btn_primary').on('click', function() {
									$('.weui-dialog_2').hide();
									$('.choice').show();
								})
							} else if(res.error_code == 2) {
								$('.weui-dialog').show();
								$('.weui-dialog__bd').html(res.data + '!');
							}
						}
					});
				} else {
					$('.weui-dialog').show();
					$('.weui-dialog__bd').html('提现金额不能小于1');
					$('.weui-dialog__btn_primary').on('click', function() {
						$('.weui-dialog').hide();
						window.location.reload();
					})
				}
			} else {

			}
		});
		$('.weui-dialog__btn_default').on('click', function() {
			$('.weui-dialog_2').hide();
			window.location.reload();
		})
		$('.choice_button').on('click', function() {
			if($('.choice_input').val().length == 0) {
				$('.weui-dialog').show();
				$('.weui-dialog__bd').html('账号或金额不能为空');
			} else {
				var aliPayAccount = $('.choice_input').val();
				$.ajax({
					type: "get",
					url: baseUrl + "foot/user/setAliPay",
					contentType: "application/json; charset=utf-8",
					data: {
						'aliPayAccount': aliPayAccount
					},
					success: function(res) {
						if(res.error_code == 0) {
							$('.weui-dialog').show();
							$('.weui-dialog__bd').html('提交成功');
							$('.weui-dialog__btn_primary').on('click', function() {
								$('.weui-dialog').hide();
								window.location.reload();
							})
						} else {
							window.location.reload();
						}
					}
				});
			}

		})

		$('.choice').on('click', function() {
			$('.choice').hide();
		})
		$('.choice_payment').on('click', function(e) {
			event.stopPropagation();
		})

	});
	$('.weui-dialog__btn_primary').on('click', function() {
		$('.weui-dialog').hide();
	})
	//					contentType: "application/json; charset=utf-8",
</script>
<script>
	$('.tab3').on('click', function() {
		$.ajax({
			type: "get",
			url: baseUrl + "/foot/advert/checkLookAdvert",
			contentType: "application/json; charset=utf-8",
			success: function(res) {
				if(res.error_code == 1) {
					$('.weui-dialog').show();
					$('.weui-dialog__bd').html(res.data);
				} else if(res.error_code == 0) {
					window.location.href = 'release.html'
				}
			}
		});
	})

</script>